import { Navigate, useRoutes } from "react-router-dom"
import { lazy } from "react"


import Home from "@/views/home/index"
const Login = lazy(() => import("@/views/login/index"))
const Assembly = lazy(() => import("@/views/home/assembly"))
const Page = lazy(() => import("@/views/home/page/index"))
const Form1 = lazy(() => import("@/views/home/Form/Form1"))
const PieChart = lazy(() => import("@/views/chart/Pie"))
const Line = lazy(() => import("@/views/chart/Line"))
const Bar = lazy(() => import("@/views/chart/Bar"))
const Map = lazy(() => import("@/views/chart/Map"))
const Form2 = lazy(() => import("@/views/home/Form/Form2"))
const Form3 = lazy(() => import("@/views/home/Form/Form3"))
const Form4 = lazy(() => import("@/views/home/Form/Form4"))
const PDF = lazy(() => import("@/views/home/Form/Form3/PDF"))
const SPDF = lazy(()=>import("@/views/home/Form/Form3/SPDF"))
const Customer = lazy(()=>import("@/views/user/customer"))
const Loss = lazy(()=>import("@/views/user/loss"))
const Product = lazy(()=>import("@/views/product/product"))
const ProdType = lazy(()=>import("@/views/product/producttype"))
const Order = lazy(()=>import("@/views/order/order"))
const MyOrder = lazy(()=>import("@/views/order/myOrder"))
const Active = lazy(()=>import("@/views/active/active"))
const ActiveCreat = lazy(()=>import("@/views/active/active/editActive"))
const ActiveInfo = lazy(()=>import("@/views/active/active/activeInfo"))
const Server = lazy(()=>import("@/views/serve/serve"))
const MyActive = lazy(()=>import("@/views/active/myActive"))
const MyServe = lazy(()=>import("@/views/serve/myserve"))
const RForm1 = lazy(()=>import("@/views/report/Form1"))
const RForm2 = lazy(()=>import("@/views/report/Form2"))
const RForm3 = lazy(()=>import("@/views/report/Form3"))

const routes = [
    {
        path: "/",
        element: <Navigate to="/Login" />
    },
    {
        path: "/Login",
        element: <Login />
    }, 
    {
        path: "/PDF",
        element: <PDF />
    },
    {
        path: "/SPDF",
        element: <SPDF />
    },
    {
        path: '/home',
        element: <Navigate to='/home/Page' />
    },
    {
        path: "/home",
        element: <Home />,
        children: [
            {
                path: "RForm3",
                element: <RForm3 />
            },
            {
                path: "RForm2",
                element: <RForm2 />
            },
            {
                path: "RForm1",
                element: <RForm1 />
            },
            {
                path: "Page",
                element: <Page />
            },
            {
                path: "Assembly",
                element: <Assembly />
            },
            {
                path: "Form1",
                element: <Form1 />
            },
            {
                path: "PieChart",
                element: <PieChart />
            },
            {
                path: "LineChart",
                element: <Line />
            },
            {
                path: "BarChart",
                element: <Bar />
            },
            {
                path: "MapChart",
                element: <Map />
            },
            {
                path: "Form2",
                element: <Form2 />
            },
            {
                path: "Form3",
                element: <Form3 />
            },
            {
                path: "Form4",
                element: <Form4 />
            },
            {
                path:'customer',
                element: <Customer />
            },
            {
                path:'loss',
                element: <Loss />
            },
            {
                path:'product',
                element: <Product />
            },
            {
                path:'prodType',
                element: <ProdType />
            },
            {
                path:'order',
                element: <Order />
            },
            {
                path:'active',
                element: <Active />
            },
            {
                path:'activeCreat',
                element: <ActiveCreat />
            },
            {
                path:'activeInfo',
                element: <ActiveInfo />
            },
            {
                path:'Server',
                element: <Server />
            },
            {
                path:'MyOrder',
                element: <MyOrder />
            },
            {
                path:'myActive',
                element: <MyActive />
            },
            {
                path:'myServe',
                element: <MyServe />
            }
        ]
    }
]

export default routes



